-- GENERATED SPELL FOR [Anachronos the Ancient] --


function spell0_15381(pUnit, Event) --@Call Glyphs of Warding,Self--
pUnit:FullCastSpellOnTarget(25166,pUnit)
pUnit:RegisterEvent('Sorts_15381', 3000, 1)
end

function spell1_15381(pUnit, Event) --@Call Prismatic Barrier,Self--
pUnit:FullCastSpellOnTarget(25159,pUnit)
pUnit:RegisterEvent('Sorts_15381', 10000, 1)
end

function spell2_15381(pUnit, Event) --@Time Stop,Self--
pUnit:FullCastSpellOnTarget(25158,pUnit)
pUnit:RegisterEvent('Sorts_15381', 3000, 1)
end

function Sorts_15381(pUnit, Event)
local choix_sorts_15381 = math.random(0, 2)
if choix_sorts_15381 == 0 then
pUnit:RegisterEvent('spell0_15381', 1, 1)
end
if choix_sorts_15381 == 1 then
pUnit:RegisterEvent('spell1_15381', 1, 1)
end
if choix_sorts_15381 == 2 then
pUnit:RegisterEvent('spell2_15381', 1, 1)
end
end

function mob15381_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_15381', math.random(1500, 3000), 1)
end

function mob15381_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob15381_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob15381_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(15381, 1, 'mob15381_Action')
RegisterUnitEvent(15381, 2, 'mob15381_Leave')
RegisterUnitEvent(15381, 3, 'mob15381_Kill')
RegisterUnitEvent(15381, 4, 'mob15381_Die')
